home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / program / wx_lib10.zoo / wx_init.c < prev    next >
C/C++ Source or Header  |  1992-08-01  |  2KB  |  56 lines

  1. #include <wx_lib.h>
  2.  
  3. /*
  4.  * This is the procedure you need to call before you use anything else related
  5.  * to the wx_lib.  This stores the vdi-handle somewhere convenient (i.e.,
  6.  * somewhere it can't be forgotten), and then sets up the vdi workstation to
  7.  * various defaults that the library requires.
  8.  *
  9.  * This may mean, in the end, that you need to have an entire other workstation
  10.  * for this library (not unlike GemFast 1.8 does).  This may be a disadvantage,
  11.  * and some people may consider it a design flaw, I guess.  It all depends on
  12.  * whether you use the VDI for anything else that might need to circumvent
  13.  * these defaults.
  14.  * 
  15.  * Arguments:    The Window structure you're going to be using, and the handle
  16.  *                to a VDI workstation.
  17.  * Returns:        TRUE if successful, FALSE if not.
  18.  */
  19. int        wx_init(ws,vh,wc,hc)
  20. Window    *ws;
  21. int        vh,
  22.         wc,
  23.         hc;
  24. {
  25.     int    junk;
  26.  
  27.     if (vh > 0) {
  28.         /*
  29.          * First, store the vdi handle in the vdih member.  So we don't have to
  30.          * waste lots of time moving it around for the other routines.
  31.          */
  32.         ws->vdih = vh;
  33.         ws->wchr = wc;
  34.         ws->hchr = hc;
  35.         /*
  36.          * Set the text alignment the way that we expect it to be.
  37.          */
  38.         vst_alignment(ws->vdih,0,5,&junk,&junk);
  39.         /*
  40.          * Set the interior fill pattern to be solid.
  41.          */
  42.         vsf_interior(ws->vdih,IP_SOLID);
  43.         /*
  44.          * Set the fill color to be while.
  45.          */
  46.         vsf_color(ws->vdih,0);
  47.         /*
  48.          * Set the text color to be black.
  49.          */
  50.         vst_color(ws->vdih,1);
  51.         return TRUE;
  52.     } else {
  53.         return FALSE;
  54.     }
  55. }
  56.